home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / ironhors.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  23KB  |  629 lines

  1. /***************************************************************************
  2.  
  3. IronHorse
  4.  
  5. driver by Mirko Buffoni
  6.  
  7. memory map (preliminary)
  8.  
  9. 0000-00ff  Work area
  10. 2000-23ff  ColorRAM
  11. 2400-27ff  VideoRAM
  12. 2800-2fff  RAM
  13. 3000-30ff  First sprite bank?
  14. 3800-38ff  Second sprite bank?
  15. 3f00-3fff  Stack AREA
  16. 4000-ffff  ROM
  17.  
  18. Read:
  19. 0b01:    Player 2 controls
  20. 0b02:    Player 1 controls
  21. 0b03:    Coin + selftest
  22. 0a00:    DSW1
  23. 0b00:    DSW2
  24. 0900:    DSW3
  25.  
  26. Write:
  27. 0003:       Bit 1 selects the 1024 char bank, bit 3 the sprite RAM bank, other bits unknown
  28. 0004:       Bit 0 controls NMI, bit 3 controls FIRQ, other bits unknown
  29. 0020-003f:  Scroll registers
  30.  
  31. ***************************************************************************/
  32.  
  33. #include "driver.h"
  34. #include "vidhrdw/generic.h"
  35. #include "cpu/m6809/m6809.h"
  36.  
  37.  
  38. extern unsigned char *ironhors_scroll;
  39. static unsigned char *ironhors_interrupt_enable;
  40.  
  41. void ironhors_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  42. WRITE_HANDLER( ironhors_palettebank_w );
  43. WRITE_HANDLER( ironhors_charbank_w );
  44. void ironhors_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  45.  
  46.  
  47.  
  48. static int ironhors_interrupt(void)
  49. {
  50.     if (cpu_getiloops() == 0)
  51.     {
  52.         if (*ironhors_interrupt_enable & 4) return M6809_INT_FIRQ;
  53.     }
  54.     else if (cpu_getiloops() % 2)
  55.     {
  56.         if (*ironhors_interrupt_enable & 1) return nmi_interrupt();
  57.     }
  58.     return ignore_interrupt();
  59. }
  60.  
  61. static WRITE_HANDLER( ironhors_sh_irqtrigger_w )
  62. {
  63.     cpu_cause_interrupt(1,0xff);
  64. }
  65.  
  66.  
  67.  
  68. static struct MemoryReadAddress ironhors_readmem[] =
  69. {
  70.     { 0x0020, 0x003f, MRA_RAM },
  71.     { 0x0b03, 0x0b03, input_port_0_r },    /* coins + selftest */
  72.     { 0x0b02, 0x0b02, input_port_1_r },    /* player 1 controls */
  73.     { 0x0b01, 0x0b01, input_port_2_r },    /* player 2 controls */
  74.     { 0x0a00, 0x0a00, input_port_3_r },    /* Dipswitch settings 0 */
  75.     { 0x0b00, 0x0b00, input_port_4_r },    /* Dipswitch settings 1 */
  76.     { 0x0900, 0x0900, input_port_5_r },    /* Dipswitch settings 2 */
  77.     { 0x2000, 0x2fff, MRA_RAM },
  78.     { 0x3000, 0x3fff, MRA_RAM },
  79.     { 0x4000, 0xffff, MRA_ROM },
  80.     { -1 }  /* end of table */
  81. };
  82.  
  83. static struct MemoryWriteAddress ironhors_writemem[] =
  84. {
  85.     { 0x0003, 0x0003, ironhors_charbank_w },
  86.     { 0x0004, 0x0004, MWA_RAM, &ironhors_interrupt_enable },
  87.     { 0x0020, 0x003f, MWA_RAM, &ironhors_scroll },
  88.     { 0x0800, 0x0800, soundlatch_w },
  89.     { 0x0900, 0x0900, ironhors_sh_irqtrigger_w },  /* cause interrupt on audio CPU */
  90.     { 0x0a00, 0x0a00, ironhors_palettebank_w },
  91.     { 0x0b00, 0x0b00, watchdog_reset_w },
  92.     { 0x2000, 0x23ff, colorram_w, &colorram },
  93.     { 0x2400, 0x27ff, videoram_w, &videoram, &videoram_size },
  94.     { 0x2800, 0x2fff, MWA_RAM },
  95.     { 0x3000, 0x30ff, MWA_RAM, &spriteram_2 },
  96.     { 0x3100, 0x37ff, MWA_RAM },
  97.     { 0x3800, 0x38ff, MWA_RAM, &spriteram, &spriteram_size },
  98.     { 0x3900, 0x3fff, MWA_RAM },
  99.     { 0x4000, 0xffff, MWA_ROM },
  100.     { -1 }  /* end of table */
  101. };
  102.  
  103. static struct MemoryReadAddress ironhors_sound_readmem[] =
  104. {
  105.     { 0x0000, 0x3fff, MRA_ROM },
  106.     { 0x4000, 0x43ff, MRA_RAM },
  107.     { 0x8000, 0x8000, soundlatch_r },
  108.     { -1 }    /* end of table */
  109. };
  110.  
  111. static struct MemoryWriteAddress ironhors_sound_writemem[] =
  112. {
  113.     { 0x0000, 0x3fff, MWA_ROM },
  114.     { 0x4000, 0x43ff, MWA_RAM },
  115.     { -1 }    /* end of table */
  116. };
  117.  
  118. static struct IOReadPort ironhors_sound_readport[] =
  119. {
  120.     { 0x00, 0x00, YM2203_status_port_0_r },
  121.     { -1 }    /* end of table */
  122. };
  123.  
  124. static struct IOWritePort ironhors_sound_writeport[] =
  125. {
  126.     { 0x00, 0x00, YM2203_control_port_0_w },
  127.     { 0x01, 0x01, YM2203_write_port_0_w },
  128.     { -1 }    /* end of table */
  129. };
  130.  
  131.  
  132.  
  133. static struct MemoryReadAddress farwest_sound_readmem[] =
  134. {
  135.     { 0x0000, 0x3fff, MRA_ROM },
  136.     { 0x4000, 0x43ff, MRA_RAM },
  137.     { 0x8000, 0x8000, soundlatch_r },
  138.     { -1 }    /* end of table */
  139. };
  140. static struct MemoryWriteAddress farwest_sound_writemem[] =
  141. {
  142.     { 0x0000, 0x3fff, MWA_ROM },
  143.     { 0x4000, 0x43ff, MWA_RAM },
  144.     { 0x8000, 0x8000, YM2203_control_port_0_w },
  145.     { 0x8001, 0x8001, YM2203_write_port_0_w },
  146.     { -1 }    /* end of table */
  147. };
  148.  
  149.  
  150.  
  151. INPUT_PORTS_START( ironhors )
  152.     PORT_START    /* IN0 */
  153.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  154.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  155.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  156.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  157.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  158.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  159.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  160.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  161.  
  162.     PORT_START    /* IN1 */
  163.     /* note that button 3 for player 1 and 2 are exchanged */
  164.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  165.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  166.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  167.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  168.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  169.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  170.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
  171.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  172.  
  173.     PORT_START    /* IN2 */
  174.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  175.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  176.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  177.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  178.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  179.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  180.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  181.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  182.  
  183.     PORT_START    /* DSW0 */
  184.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  185.     PORT_DIPSETTING(    0x03, "2" )
  186.     PORT_DIPSETTING(    0x02, "3" )
  187.     PORT_DIPSETTING(    0x01, "5" )
  188.     PORT_DIPSETTING(    0x00, "7" )
  189.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  190.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  191.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  192.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  193.     PORT_DIPSETTING(    0x18, "30000 70000" )
  194.     PORT_DIPSETTING(    0x10, "40000 80000" )
  195.     PORT_DIPSETTING(    0x08, "40000" )
  196.     PORT_DIPSETTING(    0x00, "50000" )
  197.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  198.     PORT_DIPSETTING(    0x60, "Easy" )
  199.     PORT_DIPSETTING(    0x40, "Normal" )
  200.     PORT_DIPSETTING(    0x20, "Hard" )
  201.     PORT_DIPSETTING(    0x00, "Hardest" )
  202.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  203.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  204.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  205.  
  206.     PORT_START    /* DSW1 */
  207.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  208.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  209.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  210.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  211.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  212.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  213.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  214.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  215.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  216.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  217.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  218.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  219.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  220.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  221.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  222.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  223.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  224.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  225.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  226.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  227.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  228.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  229.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  230.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  231.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  232.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  233.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  234.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  235.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  236.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  237.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  238.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  239.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  240. /*     PORT_DIPSETTING(    0x00, "Invalid" ) */
  241.  
  242.     PORT_START
  243.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
  244.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  245.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  246.     PORT_DIPNAME( 0x02, 0x02, "Controls" )
  247.     PORT_DIPSETTING(    0x02, "Single" )
  248.     PORT_DIPSETTING(    0x00, "Dual" )
  249.     PORT_DIPNAME( 0x04, 0x04, "Button Layout" )
  250.     PORT_DIPSETTING(    0x04, "Power Atk Squat" )
  251.     PORT_DIPSETTING(    0x00, "Squat Atk Power" )
  252.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
  253.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  254.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  255.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  256. INPUT_PORTS_END
  257.  
  258. INPUT_PORTS_START( dairesya )
  259.     PORT_START    /* IN0 */
  260.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  261.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  262.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  263.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  264.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  265.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  266.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  267.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  268.  
  269.     PORT_START    /* IN1 */
  270.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  271.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  272.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  273.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  274.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  275.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  276.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  277.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  278.  
  279.     PORT_START    /* IN2 */
  280.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  281.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  282.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  283.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  284.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  285.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  286.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
  287.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  288.  
  289.     PORT_START    /* DSW0 */
  290.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  291.     PORT_DIPSETTING(    0x03, "2" )
  292.     PORT_DIPSETTING(    0x02, "3" )
  293.     PORT_DIPSETTING(    0x01, "5" )
  294.     PORT_DIPSETTING(    0x00, "7" )
  295.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  296.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  297.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  298.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  299.     PORT_DIPSETTING(    0x18, "30000 70000" )
  300.     PORT_DIPSETTING(    0x10, "40000 80000" )
  301.     PORT_DIPSETTING(    0x08, "40000" )
  302.     PORT_DIPSETTING(    0x00, "50000" )
  303.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  304.     PORT_DIPSETTING(    0x60, "Easy" )
  305.     PORT_DIPSETTING(    0x40, "Normal" )
  306.     PORT_DIPSETTING(    0x20, "Hard" )
  307.     PORT_DIPSETTING(    0x00, "Hardest" )
  308.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  309.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  310.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  311.  
  312.     PORT_START    /* DSW1 */
  313.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  314.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  315.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  316.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  317.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  318.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  319.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  320.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  321.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  322.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  323.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  324.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  325.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  326.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  327.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  328.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  329.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  330.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  331.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  332.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  333.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  334.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  335.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  336.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  337.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  338.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  339.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  340.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  341.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  342.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  343.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  344.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  345.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  346. /*     PORT_DIPSETTING(    0x00, "Invalid" ) */
  347.  
  348.     PORT_START
  349.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )
  350.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  351.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  352.     PORT_DIPNAME( 0x02, 0x02, "Controls" )
  353.     PORT_DIPSETTING(    0x02, "Single" )
  354.     PORT_DIPSETTING(    0x00, "Dual" )
  355.     PORT_DIPNAME( 0x04, 0x04, "Button Layout" )
  356.     PORT_DIPSETTING(    0x04, "Power Atk Squat" )
  357.     PORT_DIPSETTING(    0x00, "Squat Atk Power" )
  358.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
  359.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  360.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  361.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  362. INPUT_PORTS_END
  363.  
  364.  
  365. static struct GfxLayout ironhors_charlayout =
  366. {
  367.     8,8,    /* 8*8 characters */
  368.     2048,    /* 2048 characters */
  369.     4,    /* 4 bits per pixel */
  370.     { 0, 1, 2, 3 },    /* the four bitplanes are packed in one nibble */
  371.     { 0*4, 1*4, 0x8000*8+0*4, 0x8000*8+1*4, 2*4, 3*4, 0x8000*8+2*4, 0x8000*8+3*4 },
  372.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  373.     16*8    /* every char takes 16 consecutive bytes */
  374. };
  375.  
  376. static struct GfxLayout ironhors_spritelayout =
  377. {
  378.     16,16,    /* 16*16 sprites */
  379.     512,    /* 512 sprites */
  380.     4,    /* 4 bits per pixel */
  381.     { 0, 1, 2, 3 },    /* the four bitplanes are packed in one nibble */
  382.     { 0*4, 1*4, 0x8000*8+0*4, 0x8000*8+1*4, 2*4, 3*4, 0x8000*8+2*4, 0x8000*8+3*4,
  383.            16*8+0*4, 16*8+1*4, 16*8+0x8000*8+0*4, 16*8+0x8000*8+1*4, 16*8+2*4, 16*8+3*4, 16*8+0x8000*8+2*4, 16*8+0x8000*8+3*4 },
  384.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  385.            16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16 },
  386.     64*8    /* every sprite takes 64 consecutive bytes */
  387. };
  388.  
  389. static struct GfxDecodeInfo ironhors_gfxdecodeinfo[] =
  390. {
  391.     { REGION_GFX1, 0, &ironhors_charlayout,         0, 16*8 },
  392.     { REGION_GFX2, 0, &ironhors_spritelayout, 16*8*16, 16*8 },
  393.     { REGION_GFX2, 0, &ironhors_charlayout,   16*8*16, 16*8 },  /* to handle 8x8 sprites */
  394.     { -1 } /* end of array */
  395. };
  396.  
  397.  
  398. static struct GfxLayout farwest_charlayout =
  399. {
  400.     8,8,    /* 8*8 characters */
  401.     2048,    /* 2048 characters */
  402.     4,    /* 4 bits per pixel */
  403.     { 0, 2, 4, 6 },    /* the four bitplanes are packed in one byte */
  404.     { 3*8+1, 3*8+0, 0*8+1, 0*8+0, 1*8+1, 1*8+0, 2*8+1, 2*8+0 },
  405.     { 0*4*8, 1*4*8, 2*4*8, 3*4*8, 4*4*8, 5*4*8, 6*4*8, 7*4*8 },
  406.     32*8    /* every char takes 32 consecutive bytes */
  407. };
  408.  
  409. static struct GfxLayout farwest_spritelayout =
  410. {
  411.     16,16,    /* 16*16 sprites */
  412.     512,    /* 512 sprites */
  413.     4,    /* 4 bits per pixel */
  414.     { 0, 512*32*8, 2*512*32*8, 3*512*32*8 },    /* the four bitplanes are separated */
  415.     { 0, 1, 2, 3, 4, 5, 6, 7,
  416.             16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
  417.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  418.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  419.     32*8    /* every sprite takes 32 consecutive bytes */
  420. };
  421.  
  422. static struct GfxLayout farwest_spritelayout2 =
  423. {
  424.     8,8,    /* 8*8 characters */
  425.     2048,    /* 2048 characters */
  426.     4,    /* 4 bits per pixel */
  427.     { 0, 2048*8*8, 2*2048*8*8, 3*2048*8*8 },    /* the four bitplanes are separated */
  428.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  429.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  430.     8*8    /* every char takes 8 consecutive bytes */
  431. };
  432.  
  433. static struct GfxDecodeInfo farwest_gfxdecodeinfo[] =
  434. {
  435.     { REGION_GFX1, 0, &farwest_charlayout,         0, 16*8 },
  436.     { REGION_GFX2, 0, &farwest_spritelayout, 16*8*16, 16*8 },
  437.     { REGION_GFX2, 0, &farwest_spritelayout2,16*8*16, 16*8 },  /* to handle 8x8 sprites */
  438.     { -1 } /* end of array */
  439. };
  440.  
  441.  
  442. static struct YM2203interface ym2203_interface =
  443. {
  444.     1,            /* 1 chip */
  445.     18432000/6,        /* 3.07 MHz?  mod by Shingo Suzuki 1999/10/15 */
  446.     { YM2203_VOL(40,40) },
  447.     { 0 },
  448.     { 0 },
  449.     { 0 },
  450.     { 0 }
  451. };
  452.  
  453.  
  454.  
  455. static struct MachineDriver machine_driver_ironhors =
  456. {
  457.     /* basic machine hardware */
  458.     {
  459.         {
  460.             CPU_M6809,
  461.             18432000/6,        /* 3.07MHz? mod by Shingo Suzuki 1999/10/15 */
  462.             ironhors_readmem,ironhors_writemem,0,0,
  463.             ironhors_interrupt,8
  464.         },
  465.         {
  466.             CPU_Z80 | CPU_AUDIO_CPU,
  467.             18432000/6,        /* 3.07MHz? mod by Shingo Suzuki 1999/10/15 */
  468.             ironhors_sound_readmem,ironhors_sound_writemem,ironhors_sound_readport,ironhors_sound_writeport,
  469.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  470.         }
  471.     },
  472.     30, DEFAULT_30HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  473.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  474.     0,
  475.  
  476.     /* video hardware */
  477.     32*8, 32*8, { 1*8, 31*8-1, 2*8, 30*8-1 },
  478.     ironhors_gfxdecodeinfo,
  479.     256,16*8*16+16*8*16,
  480.     ironhors_vh_convert_color_prom,
  481.  
  482.     VIDEO_TYPE_RASTER,
  483.     0,
  484.     generic_vh_start,
  485.     generic_vh_stop,
  486.     ironhors_vh_screenrefresh,
  487.  
  488.     /* sound hardware */
  489.     0,0,0,0,
  490.     {
  491.         {
  492.             SOUND_YM2203,
  493.             &ym2203_interface
  494.         }
  495.     }
  496. };
  497.  
  498. static struct MachineDriver machine_driver_farwest =
  499. {
  500.     /* basic machine hardware */
  501.     {
  502.         {
  503.             CPU_M6809,
  504.             2000000,        /* ? */
  505.             ironhors_readmem,ironhors_writemem,0,0,
  506.             ironhors_interrupt,8
  507.         },
  508.         {
  509.             CPU_Z80 | CPU_AUDIO_CPU,
  510.             18432000/6,        /* 3.07MHz? mod by Shingo Suzuki 1999/10/15 */
  511.             farwest_sound_readmem,farwest_sound_writemem,0,0,
  512.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  513.         }
  514.     },
  515.     30, DEFAULT_30HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  516.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  517.     0,
  518.  
  519.     /* video hardware */
  520.     32*8, 32*8, { 1*8, 31*8-1, 2*8, 30*8-1 },
  521.     farwest_gfxdecodeinfo,
  522.     256,16*8*16+16*8*16,
  523.     ironhors_vh_convert_color_prom,
  524.  
  525.     VIDEO_TYPE_RASTER,
  526.     0,
  527.     generic_vh_start,
  528.     generic_vh_stop,
  529.     ironhors_vh_screenrefresh,
  530.  
  531.     /* sound hardware */
  532.     0,0,0,0,
  533.     {
  534.         {
  535.             SOUND_YM2203,
  536.             &ym2203_interface
  537.         }
  538.     }
  539. };
  540.  
  541.  
  542.  
  543. /***************************************************************************
  544.  
  545.   Game driver(s)
  546.  
  547. ***************************************************************************/
  548.  
  549. ROM_START( ironhors )
  550.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  551.     ROM_LOAD( "13c_h03.bin",  0x4000, 0x8000, 0x24539af1 )
  552.     ROM_LOAD( "12c_h02.bin",  0xc000, 0x4000, 0xfab07f86 )
  553.  
  554.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for audio cpu */
  555.     ROM_LOAD( "10c_h01.bin",  0x0000, 0x4000, 0x2b17930f )
  556.  
  557.     ROM_REGION( 0x10000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  558.     ROM_LOAD( "09f_h07.bin",  0x00000, 0x8000, 0xc761ec73 )
  559.     ROM_LOAD( "06f_h04.bin",  0x08000, 0x8000, 0xc1486f61 )
  560.  
  561.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  562.     ROM_LOAD( "08f_h06.bin",  0x00000, 0x8000, 0xf21d8c93 )
  563.     ROM_LOAD( "07f_h05.bin",  0x08000, 0x8000, 0x60107859 )
  564.  
  565.     ROM_REGION( 0x0500, REGION_PROMS )
  566.     ROM_LOAD( "03f_h08.bin",  0x0000, 0x0100, 0x9f6ddf83 ) /* palette red */
  567.     ROM_LOAD( "04f_h09.bin",  0x0100, 0x0100, 0xe6773825 ) /* palette green */
  568.     ROM_LOAD( "05f_h10.bin",  0x0200, 0x0100, 0x30a57860 ) /* palette blue */
  569.     ROM_LOAD( "10f_h12.bin",  0x0300, 0x0100, 0x5eb33e73 ) /* character lookup table */
  570.     ROM_LOAD( "10f_h11.bin",  0x0400, 0x0100, 0xa63e37d8 ) /* sprite lookup table */
  571. ROM_END
  572.  
  573. ROM_START( dairesya )
  574.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  575.     ROM_LOAD( "560-k03.13c",  0x4000, 0x8000, 0x2ac6103b )
  576.     ROM_LOAD( "560-k02.12c",  0xc000, 0x4000, 0x07bc13a9 )
  577.  
  578.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for audio cpu */
  579.     ROM_LOAD( "560-j01.10c",  0x0000, 0x4000, 0xa203b223 )
  580.  
  581.     ROM_REGION( 0x10000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  582.     ROM_LOAD( "560-k07.9f",   0x00000, 0x8000, 0xc8a1b840 )
  583.     ROM_LOAD( "560-k04.6f",   0x08000, 0x8000, 0xc883d856 )
  584.  
  585.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  586.     ROM_LOAD( "560-j06.8f",   0x00000, 0x8000, 0xa6e8248d )
  587.     ROM_LOAD( "560-j05.7f",   0x08000, 0x8000, 0xf75893d4 )
  588.  
  589.     ROM_REGION( 0x0500, REGION_PROMS )
  590.     ROM_LOAD( "03f_h08.bin",  0x0000, 0x0100, 0x9f6ddf83 ) /* palette red */
  591.     ROM_LOAD( "04f_h09.bin",  0x0100, 0x0100, 0xe6773825 ) /* palette green */
  592.     ROM_LOAD( "05f_h10.bin",  0x0200, 0x0100, 0x30a57860 ) /* palette blue */
  593.     ROM_LOAD( "10f_h12.bin",  0x0300, 0x0100, 0x5eb33e73 ) /* character lookup table */
  594.     ROM_LOAD( "10f_h11.bin",  0x0400, 0x0100, 0xa63e37d8 ) /* sprite lookup table */
  595. ROM_END
  596.  
  597. ROM_START( farwest )
  598.     ROM_REGION( 0x12000, REGION_CPU1 )    /* 64k for code + 8k for extra ROM */
  599.     ROM_LOAD( "ironhors.008", 0x04000, 0x4000, 0xb1c8246c )
  600.     ROM_LOAD( "ironhors.009", 0x08000, 0x8000, 0xea34ecfc )
  601.     ROM_LOAD( "ironhors.007", 0x10000, 0x2000, 0x471182b7 )    /* don't know what this is for */
  602.  
  603.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for audio cpu */
  604.     ROM_LOAD( "ironhors.010", 0x0000, 0x4000, 0xa28231a6 )
  605.  
  606.     ROM_REGION( 0x10000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  607.     ROM_LOAD( "ironhors.005", 0x00000, 0x8000, 0xf77e5b83 )
  608.     ROM_LOAD( "ironhors.006", 0x08000, 0x8000, 0x7bbc0b51 )
  609.  
  610.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  611.     ROM_LOAD( "ironhors.001", 0x00000, 0x4000, 0xa8fc21d3 )
  612.     ROM_LOAD( "ironhors.002", 0x04000, 0x4000, 0x9c1e5593 )
  613.     ROM_LOAD( "ironhors.003", 0x08000, 0x4000, 0x3a0bf799 )
  614.     ROM_LOAD( "ironhors.004", 0x0c000, 0x4000, 0x1fab18a3 )
  615.  
  616.     ROM_REGION( 0x0500, REGION_PROMS )
  617.     ROM_LOAD( "ironcol.003",  0x0000, 0x0100, 0x3e3fca11 ) /* palette red */
  618.     ROM_LOAD( "ironcol.001",  0x0100, 0x0100, 0xdfb13014 ) /* palette green */
  619.     ROM_LOAD( "ironcol.002",  0x0200, 0x0100, 0x77c88430 ) /* palette blue */
  620.     ROM_LOAD( "10f_h12.bin",  0x0300, 0x0100, 0x5eb33e73 ) /* character lookup table */
  621.     ROM_LOAD( "ironcol.005",  0x0400, 0x0100, 0x15077b9c ) /* sprite lookup table */
  622. ROM_END
  623.  
  624.  
  625.  
  626. GAMEX( 1986, ironhors, 0,        ironhors, ironhors, 0, ROT0, "Konami", "Iron Horse", GAME_NO_COCKTAIL )
  627. GAMEX( 1986, dairesya, ironhors, ironhors, dairesya, 0, ROT0, "[Konami] (Kawakusu license)", "Dai Ressya Goutou (Japan)", GAME_NO_COCKTAIL )
  628. GAMEX(1986, farwest,  ironhors, farwest,  ironhors, 0, ROT0, "bootleg?", "Far West", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
  629.